package ar.com.jwa.services;
import org.springframework.beans.factory.annotation.Autowired;

import ar.com.jwa.domain.User;
import ar.com.jwa.services.UserLocalService;


public class UserLocalServiceTestCase extends ServiceTestCase {

	@Autowired
	private UserLocalService userLocalService; 
	
	public void testSearchUser(){
		User user = new User();
		user.setNickName("admin");
		user.setPassword("123456");
		boolean logged = this.getUserLocalService().login(user);
		assertEquals(true, logged);
	}
	
	public void testGetUserById(){
		
		User user = null;
		try {
			
			user = this.getUserLocalService().getUserById(new Long(1));
			
		} catch (Exception e) {
			fail(e.getMessage());
		}
		
		assertNotNull(user);
	}
	
	/**
	 * @return the userLocalService
	 */
	public UserLocalService getUserLocalService() {
		return userLocalService;
	}

	/**
	 * @param userLocalService the userLocalService to set
	 */
	public void setUserLocalService(UserLocalService userLocalService) {
		this.userLocalService = userLocalService;
	}
	
}
